package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-09 09:11
 * @description
 */
@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;


    @Override
    public void transfer(String from, String to, double money) {

        //给from减少
        accountDao.sub(from,money);

        int i=5/0;
        //给to增加
        accountDao.add(to,money);

    }















}
